<?php
	/*
	 * File: update_page_user.php
	 * Last modification: 21.07.2011
	 * Author(s): kivio.wanderley
	 * 
	 */
?>

<?php /** UPPER PHP CODE */
	$t_type = gpc_get('type_option_list');
	$t_type_id = gpc_get('type_id');

	if($t_type == 'user') {
		if(isset($t_type_id)) {
			# Post needed information for the given type and option
			$t_data = datab_get_type_data($t_type, $t_type_id);
	
			# Set post vars from 'datab_post_type_data'
			$t_people_row 	= $t_data['people_row'];
			$t_user_row 	= $t_data['user_row'];
		}
	}
	
	# User vars
	$use_username = $t_user_row['username'];
	$use_access = $t_user_row['access_level'];
?>

<form action="core/update_inc.php" method="post">
<table>
<tr>
	<td><input type="checkbox" value="upd_user"/></td>
	<td><label><?php echo lang_get('username') . ":"; ?></label></td>
	<td><?php print_text_field("upd_user", "", $use_username, 25, 25, false, "", true); ?></td>
</tr>
<tr>
	<td><input type="checkbox" value="access_option_list"/></td>
	<td><label><?php echo lang_get('access_level') . ":"; ?></label></td>
	<td><?php print_access_option_list($use_access, "access_option_list", "", 'disabled') ?></td>
</tr>
</table><br />

<?php /* Submit button and update type */
	# Get user permission
	PRINT '<input type="hidden" name="type_id" value="'.$t_type_id.'">';
	PRINT '<input type="hidden" name="update_type" value="'.$t_type.'">';
	print_submit_button('update_button'); 
?>

</form>